<template>
	<view class="content">
		<view class="desciption">
      <view>uni-app的H5复制插件</view>
      <view>兼容微信、谷歌、Safari、Firefox、QQ、360等主流浏览器</view>
      <view>试过所有H5复制插件，这个是兼容性最好的</view>
      <view>如有不兼容的情况，请留言</view>
    </view>
		<view class="text-area">
			<button type="primary" @click="copy">复制</button>
		</view>
	</view>
</template>

<script>
  import h5Copy from '@/js_sdk/junyi-h5-copy/junyi-h5-copy.js'
  
	export default {
		methods: {
      copy() {
        let content = 'H5复制插件' // 复制内容，必须字符串，数字需要转换为字符串
        const result = h5Copy(content)
        if (result === false) {
          uni.showToast({
            title:'不支持',
          })
        } else {
          uni.showToast({
            title:'复制成功',
            icon:'none'
          })
        }
        
      }
		}
	}
</script>

<style>
  .content{
    max-width: 690px;
    margin: 10px auto;
    font-size: 24px;
    padding: 10px;
   }
	.desciption{
     margin: 20px auto; 
     line-height: 1.8em;
  }
</style>
